import java.util.ArrayList;
import java.util.Scanner;

public class Main2 { 
	
	
	public static int partition(ArrayList<ArrayList<Integer>> ropes,int left,int right) {
		ArrayList<Integer> tmp=ropes.get(left);
		
		while(left<right) {
			while(ropes.get(right).get(0)>tmp.get(0)&&left<right) {
				right--;
			}
			if(ropes.get(right).get(0)<=tmp.get(0)&&left<right) {
				ropes.set(left, ropes.get(right));
				left++;
			}
			
			while(ropes.get(left).get(0)<=tmp.get(0)&&left<right) {
				left++;
			}
			if(ropes.get(left).get(0)>tmp.get(0) && left<right) {
				ropes.set(right, ropes.get(left));
				right--;
			}
		}
		
		ropes.set(left, tmp);
		
		return left;
	}
	public static void quickSort(ArrayList<ArrayList<Integer>> ropes,int left,int right) {
		if(left>=right) {
			return;
		}
		
		int key=partition(ropes,left,right);
		
		quickSort(ropes,left,key-1);
		quickSort(ropes,key+1,right);
		
		return;
	}
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
        int N = sc.nextInt();
        
        ArrayList<ArrayList<Integer>> ropes=new ArrayList<>();

        for(int i = 0; i < N; i++){
        	ArrayList<Integer> rope=new ArrayList<>();
        	rope.add(sc.nextInt());
        	rope.add(sc.nextInt());
        	ropes.add(rope);
        } 
        
        quickSort(ropes,0,N-1);
        
        for(int i=1;i<N;i++) {
        	if(ropes.get(i).get(1)<=ropes.get(i-1).get(1)) {
        		System.out.println("true");
        		return;
        	}
        }
        
        System.out.println("false");
        return;
	}
}
